package sb.tiledui;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.wilson.android.library.DrawableManager;

public class GroupPurchaseDetail extends Activity{

	GroupPurchase gp;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.gp_detail);
		
		Intent intent = getIntent();
		String gpInfoStr = intent.getStringExtra("gp");
		

		GroupPurchase gp = new GroupPurchase(gpInfoStr);

		
		//gp받아와서 초기화 시켜야되
		TextView title = (TextView)findViewById(R.id.title_gp_detail);
		title.setText(gp.title);
		
		ImageView imageView = (ImageView)findViewById(R.id.iv_gp_detail);		
		DrawableManager dm = new DrawableManager();
		dm.fetchDrawableOnThread(gp.imgUrl, imageView);
		
		TextView lowestPrice = (TextView)findViewById(R.id.lowest_price_gp_detail);
		lowestPrice.setText(gp.lowestPrice);
		
		TextView participantsNumber = (TextView)findViewById(R.id.number_of_users_gp_detail);
		int numberOfParticipants = Integer.valueOf(gp.numberOfUsersWithDeposit)+ Integer.valueOf(gp.numberOfUsersWithoutDeposit);
		participantsNumber.setText(String.valueOf(numberOfParticipants));
		
		TextView tagLowestPrice = (TextView)findViewById(R.id.tag_lowest_price_gp_detail);		
		TextView tagParticipantsNumber = (TextView)findViewById(R.id.tag_number_of_users_gp_detail);
		TextView tagDescription = (TextView)findViewById(R.id.tag_description_gp_detail);
		
		TextView description = (TextView)findViewById(R.id.description_gp_detail);
		description.setText(gp.description);
		
		
	}
	
	//join this request
	public void onClickJoinButtion(View view){
		
	}
}
